




//
//  TouchImageView.m
//  WYMusicPlayer
//
//  Created by lanou3g on 15/8/31.
//  Copyright (c) 2015年 汪洋. All rights reserved.
//

#import "TouchImageView.h"

@implementation TouchImageView

- (instancetype)initWithFrame:(CGRect)frame target:(id)target action:(SEL)action
{
    self = [super initWithFrame:frame];
    if (self) {
        //创建一个点击事件
        //将我们初始化方法内的参数填入该手势初始化方法内(target 和 action),我们将在外部调用并设置我们的点击事件
        UITapGestureRecognizer *imageTap = [[UITapGestureRecognizer alloc] initWithTarget:target action:action];
        
        //把当前的交互打开
        self.userInteractionEnabled = YES;
        
        //把手势添加至当前类
        [self addGestureRecognizer:imageTap];
    }
    return self;
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
